//
//  FSCoverView.m
//  fanshu
//
//  Created by jklin on 16/3/29.
//  Copyright © 2016年 FS. All rights reserved.
//

#import "FSMineCoverView.h"
#import "FSPWDPromptView.h"

@implementation FSMineCoverView


+(instancetype)showCoverView{
    FSMineCoverView *coverView = [[FSMineCoverView alloc]init];
    coverView.backgroundColor = [UIColor blackColor];
    coverView.alpha = 0.8;
    coverView.frame = [UIScreen mainScreen].bounds;
    [[UIApplication sharedApplication].keyWindow addSubview:coverView];
    return coverView;

}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self removeCoverView];
}
-(void)removeCoverView{
    for (UIView *view in [[UIApplication sharedApplication].keyWindow subviews]) {
        if ([view isKindOfClass:[FSPWDPromptView class]] ) {
            [view removeFromSuperview];
        }
    }
    
    [self removeFromSuperview];
}

@end
